package com.westos.todo.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MySpring {
	private static MySpring me = new MySpring();
	private ApplicationContext context;
	private MySpring(){
		try {
			init();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	private void init() {
		String pathname = "spring.xml";
		context = new ClassPathXmlApplicationContext(pathname);
	}
	public static MySpring getInstance() {
		return me;
	}
	public Object getBean(String name) {
		return context.getBean(name);
	}
}
